package com.yanqu.road.server.cmd.cross.player;


import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.winery.WineryProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_TO_WINERY_VISIT_RESP, desc = "跨服拜访玩家酒坊响应")

public class CrossWineryVisitRespCmd extends AbstractCommand {


    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        WineryProto.CrossWineryVisitRespMsg crossWineryVisitRespMsg = WineryProto.CrossWineryVisitRespMsg.parseFrom(packet.getBytes());
        WineryProto.WineryVisitRespMsg.Builder builder = WineryProto.WineryVisitRespMsg.newBuilder();
        builder.addAllWineryDataArray(crossWineryVisitRespMsg.getRespData().getWineryDataArrayList());
        builder.setBadgeLevel(crossWineryVisitRespMsg.getRespData().getBadgeLevel());
        builder.setVisitName(crossWineryVisitRespMsg.getRespData().getVisitName());
        player.sendPacket(Protocol.U_WINERY_VISIT, builder);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
